package com.paomi.client.activity.receive;

import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.paomi.client.R;
import com.paomi.client.activity.person.model.CardJsonBean;
import com.paomi.client.activity.receive.adapter.CardReceiveListAdapter;
import com.paomi.client.base.BaseMvpActivity;
import com.paomi.client.utils.UIUtils;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * Created by pc on 2019/1/30
 * Describe:领取卡券列表页面
 * com.paomi.client.activity.receive
 */
public class CardReceiveActivity extends BaseMvpActivity<CardReceiveView, CardReciverPresenter> {
    @BindView(R.id.received_list)
    RecyclerView receivedList;
    private CardReceiveListAdapter listAdapter;
    private List<CardJsonBean> dataList = new ArrayList<>();

    @Override
    protected String setTitle() {
        return getResources().getString(R.string.card_receive) + getResources().getString(R.string.card_voucher);
    }

    @Override
    protected void showBack(TextView button_goback) {
        button_goback.setVisibility(View.VISIBLE);
        button_goback.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
        button_goback.setTextColor(getResources().getColor(R.color.main_color));
        button_goback.setText(getResources().getString(R.string.back_normal) + "返回");
        button_goback.setTypeface(iconfont);
    }

    @NonNull
    @Override
    protected int getLayoutId() {
        return R.layout.activity_receive_card;
    }

    @Override
    protected void initEvent() {
        receivedList.setLayoutManager(UIUtils.getRecyclerViewManager(false,this));
        listAdapter=new CardReceiveListAdapter(this,iconfont);
        receivedList.setAdapter(listAdapter);
        dataList.clear();
        CardJsonBean cardJsonBean=new CardJsonBean();
        dataList.add(cardJsonBean);
        dataList.add(cardJsonBean);
        dataList.add(cardJsonBean);
        dataList.add(cardJsonBean);
        dataList.add(cardJsonBean);
        listAdapter.setData(dataList);
    }

    @NonNull
    @Override
    public CardReciverPresenter createPresenter() {
        return new CardReciverPresenter();
    }
}
